package org.zoomdev.zoom.aop.factory;

import org.zoomdev.zoom.aop.ProxyObject;

import java.lang.reflect.Method;

public class ExternalInterfaceProxy implements ProxyObject<String> {


    @Override
    public String create(Class<?> interfaceOrAbstractClass, Object instance, Method method) {
        return method.getName();
    }

    @Override
    public Object invoke(String config, Object[] args) throws Throwable {
        if (config.equals("login")) {
            System.out.println("login");
            return true;
        }
        if (config.equals("logout")) {
            System.out.println("logout");
        }
        return null;
    }
}
